import 'package:flutter_hf/interceptors/token_interceptor.dart';
import 'package:xr_base/common.dart';
import 'package:xr_dio/xr_dio.dart';

import 'device_util.dart';

class HttpUtil {
  static initDio() async {
    HttpConfig _config = HttpConfig(baseUrl: Constant.server_address, proxy: '192.168.100.19:8888', interceptors: [
      TokenInterceptor()
    ], headers: {
      'version': Constant.server_version,
      'device-type': DeviceInfoUtil.deviceType,
      'device-id': (await DeviceInfoUtil.identifier ?? ''),
      'channel-id': Constant.channel_id
    });
    XrHttpClient.getInstance().setHttpConfig(_config);
  }
}
